package org.spring.boot.sample.simple.controller;

import java.util.concurrent.atomic.AtomicLong;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SmsController {
	
	private static AtomicLong count = new AtomicLong(0);
	
	@RequestMapping(value = "/sms/{phone}", method = RequestMethod.GET)
	public String sendSms(@PathVariable String phone) throws InterruptedException{
		System.out.println("向" + phone + "发送短信，内容: " + count.getAndIncrement());
		return "send ok!";
	}
}
